class Solution:
    def getSmallestString(self, n: int, k: int) -> str:
        s = ['a']*n
        k -= n
        for i in range(n-1,-1,-1):
            if k>25:
                s[i] = 'z'
                k -=25
            else:
                s[i] = chr(97+k)
                break

        return "".join(s)



if __name__ == '__main__':
    n= 3
    k= 27
    solution = Solution()
    val = solution.getSmallestString(n,k)
    print(val)
